#!/bin/bash

cat > /etc/profile.d/sdk.sh << EOF
#!/bin/bash
# android 环境变量
# avd  ANDROID_AVD_HOME
# android 环境变量
# android 环境变量
# android 环境变量
export ANDROID_SDK_HOME=\$HOME/.local/android
export ANDROID_NDK=\$ANDROID_SDK_HOME/ndk/23.1.7779620
export TOOLCHAINS=\$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
export SYSROOT=\$TOOLCHAINS/sysroot
export NM=\$TOOLCHAINS/bin/llvm-nm
export STRIP=\$TOOLCHAINS/bin/llvm-strip
export PKG_CFG=\$TOOLCHAINS/bin/llvm-config
export NDK_BIN=\$TOOLCHAINS/bin

# java 环境变量
export JAVA_HOME=/mnt/java/jdk-21.0.2
export JAVA_BIN=\$JAVA_HOME/bin


export TOOLS_FFMPEG=/var/opt/ffmpeg
export PKG_CONFIG_PATH=\$TOOLS_FFMPEG/lib/pkgconfig:\$TOOLS_FFMPEG/lib64/pkgconfig
export LD_LIBRARY_PATH=\$TOOLS_FFMPEG/lib


# 执行文件路径
export PATH=\$ANDROID_SDK_HOME/cmdline-tools/latest/bin:\$NDK_BIN:\$JAVA_BIN:\$MY_FFMPEG/bin:\$TOOLS_FFMPEG/bin:\$PATH
EOF

source /etc/profile
ldconfig


cat > /etc/profile.d/myffmpeg.sh << EOF
#!/bin/bash
export MY_FFMPEG=/mnt/nas/work/sdk/ffmpeg-4-4-4
export PKG_CONFIG_PATH="\${MY_FFMPEG}/lib/pkgconfig:\${MY_FFMPEG}/lib64/pkgconfig"
export PATH=\$MY_FFMPEG/bin:\$PATH

EOF

echo "/mnt/nas/work/sdk/ffmpeg-4-4-4/lib" > /etc/ld.so.conf.d/ffmpeg.conf
echo "/mnt/nas/work/sdk/ffmpeg-4-4-4/lib64" >> /etc/ld.so.conf.d/ffmpeg.conf









